#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    //创建一个填写信息的页面
    ui->lineEdit_name->setPlaceholderText("请输入账号");
    ui->lineEdit_name->setClearButtonEnabled(true);

    ui->lineEdit_passworld->setPlaceholderText("请输入密码");
    ui->lineEdit_passworld->setClearButtonEnabled(true);
    ui->lineEdit_passworld->setEchoMode(QLineEdit::Password);

    ui->lineEdit_phone->setInputMask("000-0000-0000");

}

Widget::~Widget()
{
    delete ui;
}


////通过点击日历上的日期来显示现在的时间
//void Widget::on_calendarWidget_selectionChanged()
//{
//    QDate date = ui->calendarWidget->selectedDate();
//    qDebug() << date;
//    ui->label->setText(date.toString());
//}

void Widget::on_pushButton_clicked()
{
    QString ret = ui->radioButton_nan->isChecked() == true? "男" : "女";
    qDebug()<<"姓名 "<<ui->lineEdit_name->text()
            <<"密码 "<<ui->lineEdit_phone->text()
            <<"性别 "<<ret
            <<"电话 "<<ui->lineEdit_phone->text();
}
